package pta06;

import java.lang.reflect.Array;
import java.util.Scanner;

public class Main3{

	public static void main(String[] args)  {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		double[] arr=new double[n];
		double Max 
		ArrayUtils.findMax(arr,1,1);
		for(int i=0;i<arr.length;i++){
			arr[i]=sc.nextDouble();
		}
		while(sc.hasNextInt()){
			int begin=sc.nextInt();
			int end=sc.nextInt();
			double Max=0;
			try{
				Max ArrayUtils.findMax(arr, begin, end);
				System.out.println(Max);
			}catch(IllegalAccessException e){
				System.out.println(e);
			}
		}
		try{
			System.out.println(Array.class.getDeclareMethod("findMax",double[].class,int.class));
		}catch(Exception e1){System.out.println(e1);}
	}

	private void findMax(double[] arr, int begin, int end) {
		// TODO Auto-generated method stub
		
	}
}
		